package com.feicheng.house.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.feicheng.house.result.ResultInfo;
import com.feicheng.house.service.IDepositClientVoService;
import com.feicheng.house.service.IDepositRecordClientUserVoService;

/**
 * <p>
 * VIEW 前端控制器
 * </p>
 *
 * @author feichengTech
 * @since 2021-11-22
 */
@RestController
@RequestMapping("/house/deposit-client-vo")
public class DepositClientVoController {
	@Autowired
	IDepositClientVoService iDepositClientVoService;
	/**
	 * 根据相关入参查询client表，若无全查询client表
	 * @param currentPage
	 * @param pageSize
	 * @param searchKey	 
	 * @param searchState 
	 * @return 查询到的押金记录和分页详情
	 */
	@GetMapping("/page")
	ResultInfo getList(
				@RequestParam(defaultValue = "1") Integer currentPage,
			    @RequestParam(defaultValue = "10")Integer pageSize,
			    String searchKey,String searchState) {
		return iDepositClientVoService.selectAll(currentPage, pageSize, searchKey , searchState);
	}
	
	/**
	 * 根据押金编号查询对应记录
	 * @param depositId 押金编号
	 * @return 查询到的记录
	 */
	@GetMapping("/info")
	public ResultInfo getDeposit(Integer depositId) {
		return iDepositClientVoService.getDeposit(depositId);
	}

}

